package com.demo.transaction.controller;

import com.demo.transaction.repository.primary.hello.mapper.PrimaryHelloMapper;
import com.demo.transaction.repository.secondary.hello.domain.SecondaryHello;
import com.demo.transaction.repository.secondary.hello.mapper.SecondaryHelloMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/secondary/hello/")
public class SecondaryHelloController {

    @Autowired
    SecondaryHelloMapper secondaryHelloMapper;

    @RequestMapping("list")
    @ResponseBody
    public List<SecondaryHello> list() {
        return this.secondaryHelloMapper.list();
    }

    @RequestMapping("query")
    @ResponseBody
    public SecondaryHello query(Integer id) {
        return this.secondaryHelloMapper.get(id);
    }


}
